# Maintainer: Maxim Baz <archlinux at maximbaz dot com>
# Contributor: Maxime de Roucy <maxime.deroucy@gmail.com>
# Contributor: David Manouchehri <manouchehri@riseup.net>
# Contributor: Sven Lechner <SirWindfield@users.noreply.github.com>

pkgname=pam-u2f
_name="${pkgname/-/_}"
pkgver=1.3.0
pkgrel=1
pkgdesc='Universal 2nd Factor (U2F) PAM authentication module from Yubico'
arch=('loong64' 'x86_64')
url='https://developers.yubico.com/pam-u2f'
license=('BSD')
replaces=("${_name}")
depends=('libfido2' 'openssl' 'pam')
makedepends=('asciidoc')
source=("${url}/Releases/${_name}-${pkgver}.tar.gz"{,.sig})
b2sums=('602ce0fd00105f7fbdea1805a5efde1302149d9f7977f3c52d576d7f4b9a1a95678b1463f19107b494e62c3722e319e05e0ec54f5839f70b855b59eecdf92112'
        'SKIP')
validpgpkeys=(
    'B70D62AA6A31AD6B9E4F9F4BDC8888925D25CA7A' # Alessio Di Mauro <alessio@yubico.com>
    '78D997D53E9C0A2A205392ED14A19784723C9988' # Ludvig Michaelsson <ludvig.michaelsson@yubico.com>
)

build() {
    cd "${_name}-${pkgver}"
    ./configure \
        --prefix=/usr \
        --with-pam-dir=/usr/lib/security
    make
}

check() {
    cd "${_name}-${pkgver}"
    make check
}

package() {
    cd "${_name}-${pkgver}"
    make DESTDIR="${pkgdir}" install
    install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" COPYING
}

# vim:set ts=4 sw=4 et:
